﻿CREATE procedure spReportPTSPearlVarianceByLobParent
as
SELECT
	 LobParent as [Lob Parent]
	 , GOC
	 , PTSLine as [PTS Line]
	 , SUM(PearlYTDAmount) as [Pearl YTD Amount]
	 , SUM(PTSYTDAmount) as [PTS YTD Amount]
	 , SUM(PearlYTDAmount) - SUM(PTSYTDAmount) as [Variance Pearl B/(W) PTS]
FROM vwPTSPearlReconciled
WHERE PTSLine IN ('Labor Cost', 'Labor Cost, account sem mapeamento')
GROUP BY LobParent, PTSLine, GOC
ORDER BY LobParent, PTSLine, GOC